//
//  UILabel+ZKChain.m
//  ChainFun
//
//  Created by 洪绵卫 on 2022/1/10.
//

#import "UILabel+ZKChain.h"

@implementation UILabel (ZKChain)

+ (UILabel * _Nonnull (^)(void))zk_allocInit{
    return ^{
         UILabel *v = [[UILabel alloc]init];
        return v;
    };
}

+ (UILabel * _Nonnull (^)(CGRect))zk_allocInitWithFrame{
    return ^(CGRect rect){
        UILabel * v = [[UILabel alloc]initWithFrame:rect];
        return v;
    };
}

- (UILabel * _Nonnull (^)(CGRect))zk_frame{
    return ^(CGRect rect){
        self.frame = rect;
        return self;
    };
}

- (UILabel * _Nonnull (^)(UIColor * _Nonnull))zk_backgroundColor{
    return ^(UIColor *color){
        self.backgroundColor = color;
        return self;
    };
}

- (UILabel * _Nonnull (^)(UIView * _Nonnull))zk_addToSuperView{
    return ^(UIView *view){
        [view addSubview:self];
        return self;
    };
}

- (UILabel * _Nonnull (^)(BOOL))zk_userInteractionEnabled{
    return ^(BOOL isUserInteractionEnabled){
        self.userInteractionEnabled = isUserInteractionEnabled;
        return self;
    };
}

- (UILabel * _Nonnull (^)(NSInteger))zk_tag{
    return ^(NSInteger tag){
        self.tag = tag;
        return self;
    };
}

- (UILabel * _Nonnull (^)(CGRect))zk_bounds;{
    return ^(CGRect rect){
        self.bounds = rect;
        return self;
    };
}

- (UILabel * _Nonnull (^)(CGPoint))zk_center{
    return ^(CGPoint point){
        self.center = point;
        return self;
    };
}

- (UILabel * _Nonnull (^)(CGFloat))zk_alpha{
    return ^(CGFloat value){
        self.alpha = value;
        return self;
    };
}

- (UILabel * _Nonnull (^)(BOOL))zk_hidden{
    return ^(BOOL isHidden){
        self.hidden = isHidden;
        return self;
    };
}

- (UILabel * _Nonnull (^)(UIColor * _Nonnull))zk_tintColor{
    return ^(UIColor *col){
        self.tintColor = col;
        return self;
    };
}


#pragma mark 对应UILabel 的一些属性
/* UILabel 的 */
- (UILabel * _Nonnull (^)(NSString * _Nullable))zk_text{
    return ^(NSString *string){
        self.text = string;
        return self;
    };
}

- (UILabel * _Nonnull (^)(UIFont * _Nullable))zk_font{
    return ^(UIFont *font){
        self.font = font;
        return self;
    };
}

- (UILabel * _Nonnull (^)(UIColor * _Nullable))zk_textColor{
    return ^(UIColor *color){
        self.textColor = color;
        return self;
    };
}

- (UILabel * _Nonnull (^)(UIColor * _Nullable))zk_shadowColor{
    return ^(UIColor *color){
        self.shadowColor = color;
        return self;
    };
}

- (UILabel * _Nonnull (^)(CGSize))zk_shadowOffset{
    return ^(CGSize size){
        self.shadowOffset = size;
        return self;
    };
}

- (UILabel * _Nonnull (^)(NSTextAlignment))zk_textAlignment{
    return ^(NSTextAlignment aligment){
        self.textAlignment = aligment;
        return self;
    };
}

- (UILabel * _Nonnull (^)(NSLineBreakMode))zk_lineBreakMode{
    return ^(NSLineBreakMode lineBreakMode){
        self.lineBreakMode = lineBreakMode;
        return self;
    };
}

- (UILabel * _Nonnull (^)(NSAttributedString * _Nullable))zk_attributedText{
    return ^(NSAttributedString *attributedText){
        self.attributedText = attributedText;
        return self;
    };
}

- (UILabel * _Nonnull (^)(UIColor * _Nullable))zk_highlightedTextColor{
    return ^(UIColor *highlightedTextColor){
        self.highlightedTextColor = highlightedTextColor;
        return self;
    };
}

- (UILabel * _Nonnull (^)(BOOL))zk_enabled{
    return ^(BOOL isEnabled){
        self.enabled = isEnabled;
        return self;
    };
}

- (UILabel * _Nonnull (^)(NSInteger))zk_numberOfLines{
    return ^(NSInteger numberOfLines){
        self.numberOfLines = numberOfLines;
        return self;
    };
}

- (UILabel * _Nonnull (^)(BOOL))zk_adjustsFontSizeToFitWidth{
    return ^(BOOL isAdjustsFontSizeToFitWidth){
        self.adjustsFontSizeToFitWidth = isAdjustsFontSizeToFitWidth;
        return self;
    };
}

- (UILabel * _Nonnull (^)(UIBaselineAdjustment))zk_baselineAdjustment{
    return ^(UIBaselineAdjustment adjustment){
        self.baselineAdjustment = adjustment;
        return self;
    };
}

- (UILabel * _Nonnull (^)(CGFloat))zk_minimumScaleFactor{
    return ^(CGFloat minimumScaleFactor){
        self.minimumScaleFactor = minimumScaleFactor;
        return self;
    };
}

- (UILabel * _Nonnull (^)(BOOL))zk_allowsDefaultTighteningForTruncation{
    return ^(BOOL allowsDefaultTighteningForTruncation){
        self.allowsDefaultTighteningForTruncation = allowsDefaultTighteningForTruncation;
        return self;
    };
}

- (UILabel * _Nonnull (^)(NSLineBreakStrategy))zk_lineBreakStrategy{
    return ^(NSLineBreakStrategy lineBreakStrategy){
        self.lineBreakStrategy = lineBreakStrategy;
        return self;
    };
}

- (UILabel * _Nonnull (^)(CGFloat))zk_preferredMaxLayoutWidth{
    return ^(CGFloat preferredMaxLayoutWidth){
        self.preferredMaxLayoutWidth = preferredMaxLayoutWidth;
        return self;
    };
}

- (UILabel * _Nonnull (^)(BOOL))zk_showsExpansionTextWhenTruncated{
    return ^(BOOL showsExpansionTextWhenTruncated){
        self.showsExpansionTextWhenTruncated = showsExpansionTextWhenTruncated;
        return self;
    };
}

@end
